package com.eps.entity;


import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author CAROLINA
 */
@Entity
@Table(name = "Casilla")
@NamedQueries({@NamedQuery(name = "Casilla.findAll", query = "SELECT c FROM Casilla c"), @NamedQuery(name = "Casilla.findByIdCasilla", query = "SELECT c FROM Casilla c WHERE c.idCasilla = :idCasilla"), @NamedQuery(name = "Casilla.findByDescripcion", query = "SELECT c FROM Casilla c WHERE c.descripcion = :descripcion")})
public class Casilla implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_casilla")
    private Long idCasilla;
    @Column(name = "descripcion")
    private String descripcion;
    @OneToMany(mappedBy = "casilla")
    private List<UbicacionSuministro> ubicacionSuministroList;
    @JoinColumn(name = "id_estante", referencedColumnName = "id_Estante")
    @ManyToOne
    private Estante idEstante;

    public Casilla() {
    }

    public Casilla(Long idCasilla) {
        this.idCasilla = idCasilla;
    }

    public Long getIdCasilla() {
        return idCasilla;
    }

    public void setIdCasilla(Long idCasilla) {
        this.idCasilla = idCasilla;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public List<UbicacionSuministro> getUbicacionSuministroList() {
        return ubicacionSuministroList;
    }

    public void setUbicacionSuministroList(List<UbicacionSuministro> ubicacionSuministroList) {
        this.ubicacionSuministroList = ubicacionSuministroList;
    }

    public Estante getIdEstante() {
        return idEstante;
    }

    public void setIdEstante(Estante idEstante) {
        this.idEstante = idEstante;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCasilla != null ? idCasilla.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {

        if (!(object instanceof Casilla)) {
            return false;
        }
        Casilla other = (Casilla) object;
        if ((this.idCasilla == null && other.idCasilla != null) || (this.idCasilla != null && !this.idCasilla.equals(other.idCasilla))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.entity.Casilla[idCasilla=" + idCasilla + "]";
    }

}

